package com.diors.game.engine.network;

import com.diors.commons.network.DispatcherHandler;
import com.diors.commons.network.server.AbstractServer;
import com.diors.commons.network.server.DiorsServer;

/**
 * 游戏服务器
 * @author	darren.ouyang
 * @data	2013-9-9
 */
public class GameServer 
{

	private static AbstractServer server;
	
	/**
	 * 初始化游戏服务器
	 * @param port
	 * @return
	 * @create	2013-9-9	darren.ouyang
	 */
	public static synchronized AbstractServer init (int port)
	{			
		server = new DiorsServer(new DispatcherHandler(new GameClientFactory()), port);
		
		return getServer();
	}
	
	/**
	 * 返回服务器实体
	 * @return
	 * @create	2013-9-9	darren.ouyang
	 */
	public static synchronized AbstractServer getServer ()
	{
			return server;
	}
	
}
